package com.wanmait.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 楼栋、单元、房屋、住户、入住信息
 */
@Data
@Accessors(chain = true)
@TableName(value = "residence")
public class Residence {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "building")
    @NotNull(message = "楼栋不能为空")
    private Integer building;

    @TableField(value = "unit")
    @NotNull(message = "单元不能为空")
    private Integer unit;

    @TableField(value = "room")
    @NotNull(message = "房间不能为空")
    private Integer room;

    /**
     * 业主是那位
     */
    @TableField(value = "`uid`")
    @NotNull(message = "房间的业主不能为空")
    private Integer uid;

    /**
     * 入住时间
     */
    @TableField(value = "input_time")
    @NotNull(message = "入住时间不能为空")
    private Date inputTime;

    /**
     * 退房时间
     */
    @TableField(value = "delete_time")
    private Date deleteTime;

    /**
     * 创建人
     */
    @TableField(value = "creat_by")
    private Integer creatBy;

    /**
     * 创建时间
     */
    @TableField(value = "creat_time")
    private Date creatTime;

    /**
     * 修改人
     */
    @TableField(value = "update_by")
    private Integer updateBy;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(value = "`enable`")
    private Integer enable;
}